﻿using System;
using System.Data;
using System.Text;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Data_Ajax_Top : System.Web.UI.Page
{
    private StringBuilder strchar = new StringBuilder();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["Active"].ToString() == "time")
        {
            strchar.Append(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            Response.Write(strchar.ToString());
        }
        else if (Request.QueryString["Active"].ToString() == "SmsCount")
        {

            //navi_index.InnerHtml = getMenu();
            //新逻辑判断整合权限
            //1、根据numid调用webservice
            if (Session["UserID"] != null && Session["UserID"].ToString() != "")
            {
                int count = 0;
                count = new Cisoft.Cisoft3G.BLL.SentBO().GetList(" ST_SentTime >='" + DateTime.Now.ToShortDateString() +
                    " 00:00:00' and ST_SentTime <='" + DateTime.Now.ToShortDateString() + " 23:59:59' ").Tables[0].Rows.Count +
                    new Cisoft.Cisoft3G.BLL.OutboxBO().GetList(" OB_SendTime >='" + DateTime.Now.ToShortDateString() +
                    " 00:00:00' and OB_SendTime <='" + DateTime.Now.ToShortDateString() + " 23:59:59' ").Tables[0].Rows.Count;
                if (count > 5)
                {

                    //lblSmsCount.Text = "本日短信配额已用完。";
                    strchar.Append("本日短信配额已用完。");
                }
                else
                {
                    int countnow = 0;
                    countnow = 5 - count;
                    string strtip = "本日短信配额剩余" + countnow.ToString() + "条。";
                    //lblSmsCount.Text = "本日短信配额剩余" + countnow.ToString() + "条。";
                    strchar.Append(strtip);
                }

                //strchar.Append("<select size=\"4\" name=\"SelectList\" id=\"Select1\" style=\"height:130px;width:200px;\">");
                //strchar.Append("    <option value=\"0\">姓名</option>");
                //strchar.Append("    <option value=\"0\">单位</option>");
                //strchar.Append("</select>");

                //strchar.Append(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
            }
            else
            {
               
               
            }



            
            

            Response.Write(strchar.ToString());
        }
    }
}
